package Modulos;

import interfaces.IControlador;
import interfaces.IVista;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.JTextField;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Overpower
 */
public class ListadoVista extends javax.swing.JPanel implements IVista {

    /**
     * Creates new form ListadoVista
     */
    
    IControlador _controlador;
    
    public ListadoVista() {
        initComponents();
    }
   
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        _scroll = new javax.swing.JScrollPane();
        _tabla = new javax.swing.JTable();
        _botonMas = new javax.swing.JButton();
        _botonMenos = new javax.swing.JButton();
        _botonRePag = new javax.swing.JButton();
        _botonAvPag = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        _cbBuscar = new javax.swing.JComboBox();
        _tfBuscar = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        _cbOrdenar = new javax.swing.JComboBox();
        jLabel3 = new javax.swing.JLabel();
        _cbRegistroPagina = new javax.swing.JComboBox();
        _checkRango = new javax.swing.JCheckBox();
        _tfBuscarRango = new javax.swing.JTextField();
        _botonBuscar = new javax.swing.JButton();

        _scroll.setAutoscrolls(true);

        _tabla.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        _tabla.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        _scroll.setViewportView(_tabla);

        _botonMas.setBackground(new java.awt.Color(204, 204, 204));
        _botonMas.setIcon(new javax.swing.ImageIcon("D:\\My Data\\Analista de Sistemas\\Segundo Año\\Programacion II\\GestionCESMI\\Recursos\\Imagenes\\add.png")); // NOI18N
        _botonMas.setToolTipText("Dar de Alta");
        _botonMas.setBorder(null);
        _botonMas.setBorderPainted(false);
        _botonMas.setMargin(new java.awt.Insets(2, 2, 2, 2));
        _botonMas.setMaximumSize(new java.awt.Dimension(32, 32));
        _botonMas.setMinimumSize(new java.awt.Dimension(32, 32));
        _botonMas.setPreferredSize(new java.awt.Dimension(32, 32));

        _botonMenos.setBackground(new java.awt.Color(204, 204, 204));
        _botonMenos.setIcon(new javax.swing.ImageIcon("D:\\My Data\\Analista de Sistemas\\Segundo Año\\Programacion II\\GestionCESMI\\Recursos\\Imagenes\\remove.png")); // NOI18N
        _botonMenos.setToolTipText("Dar de Baja");
        _botonMenos.setBorder(null);
        _botonMenos.setBorderPainted(false);
        _botonMenos.setEnabled(false);
        _botonMenos.setMargin(new java.awt.Insets(2, 2, 2, 2));
        _botonMenos.setMaximumSize(new java.awt.Dimension(32, 32));
        _botonMenos.setMinimumSize(new java.awt.Dimension(32, 32));
        _botonMenos.setPreferredSize(new java.awt.Dimension(32, 32));

        _botonRePag.setBackground(new java.awt.Color(204, 204, 204));
        _botonRePag.setIcon(new javax.swing.ImageIcon("D:\\My Data\\Analista de Sistemas\\Segundo Año\\Programacion II\\GestionCESMI\\Recursos\\Imagenes\\remove.png")); // NOI18N
        _botonRePag.setToolTipText("Retroceder Pagina");
        _botonRePag.setBorder(null);
        _botonRePag.setBorderPainted(false);
        _botonRePag.setEnabled(false);
        _botonRePag.setMargin(new java.awt.Insets(2, 2, 2, 2));
        _botonRePag.setMaximumSize(new java.awt.Dimension(32, 32));
        _botonRePag.setMinimumSize(new java.awt.Dimension(32, 32));
        _botonRePag.setPreferredSize(new java.awt.Dimension(32, 32));

        _botonAvPag.setBackground(new java.awt.Color(204, 204, 204));
        _botonAvPag.setIcon(new javax.swing.ImageIcon("D:\\My Data\\Analista de Sistemas\\Segundo Año\\Programacion II\\GestionCESMI\\Recursos\\Imagenes\\add.png")); // NOI18N
        _botonAvPag.setToolTipText("Avanzar Pagina");
        _botonAvPag.setBorder(null);
        _botonAvPag.setBorderPainted(false);
        _botonAvPag.setEnabled(false);
        _botonAvPag.setMargin(new java.awt.Insets(2, 2, 2, 2));
        _botonAvPag.setMaximumSize(new java.awt.Dimension(32, 32));
        _botonAvPag.setMinimumSize(new java.awt.Dimension(32, 32));
        _botonAvPag.setPreferredSize(new java.awt.Dimension(32, 32));

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Filtros"));

        jLabel2.setText("Ordenar:");

        jLabel3.setText("Registros por Pagina:");

        _cbRegistroPagina.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "10", "20", "30", "40", "50", "100", "150", "200" }));
        _cbRegistroPagina.setSelectedIndex(1);
        _cbRegistroPagina.setToolTipText("");

        _checkRango.setText("Rango");

        _tfBuscarRango.setEnabled(false);

        _botonBuscar.setText("Buscar");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel2)
                                .addGap(131, 131, 131))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                .addComponent(_cbOrdenar, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)))
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel3)
                            .addComponent(_cbRegistroPagina, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(_tfBuscar, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(_tfBuscarRango, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(_cbBuscar, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(_checkRango))
                    .addComponent(_botonBuscar))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(_cbBuscar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(_checkRango))
                .addGap(4, 4, 4)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(_tfBuscar, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(_tfBuscarRango, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(_botonBuscar)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jLabel3))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(_cbOrdenar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(_cbRegistroPagina, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(_botonRePag, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(_botonAvPag, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(_botonMenos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(_botonMas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(_scroll, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(_scroll, javax.swing.GroupLayout.DEFAULT_SIZE, 375, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(_botonMas, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(_botonMenos, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(_botonAvPag, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(_botonRePag, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents
    /*    */

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton _botonAvPag;
    private javax.swing.JButton _botonBuscar;
    private javax.swing.JButton _botonMas;
    private javax.swing.JButton _botonMenos;
    private javax.swing.JButton _botonRePag;
    private javax.swing.JComboBox _cbBuscar;
    private javax.swing.JComboBox _cbOrdenar;
    private javax.swing.JComboBox _cbRegistroPagina;
    private javax.swing.JCheckBox _checkRango;
    private javax.swing.JScrollPane _scroll;
    private javax.swing.JTable _tabla;
    private javax.swing.JTextField _tfBuscar;
    private javax.swing.JTextField _tfBuscarRango;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JPanel jPanel1;
    // End of variables declaration//GEN-END:variables

    public JButton getBotonMas() {
        return _botonMas;
    }

    public JButton getBotonMenos() {
        return _botonMenos;
    }

    public JTable getTabla() {
        return _tabla;
    }

    public JButton getBotonAvPag() {
        return _botonAvPag;
    }

    public JButton getBotonBuscar() {
        return _botonBuscar;
    }

    public JButton getBotonRePag() {
        return _botonRePag;
    }

    public JComboBox getComboBuscar() {
        return _cbBuscar;
    }

    public JComboBox getComboOrdenar() {
        return _cbOrdenar;
    }

    public JComboBox getComboRegistroPagina() {
        return _cbRegistroPagina;
    }

    public JCheckBox getCheckRango() {
        return _checkRango;
    }

    public JTextField getFieldBuscar() {
        return _tfBuscar;
    }

    public JTextField getFieldBuscarRango() {
        return _tfBuscarRango;
    }
    
    public JPanel getPanel()
    {
        return jPanel1;
    }
    
    @Override
    public void setControlador(IControlador _controlador) {
        this._controlador = _controlador;
    }

    @Override
    public IControlador getControlador() {
        return _controlador;
    }

}
